import requests
import parsel
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36'
}
url = 'https://www.baidu.com/s?tn=02003390_43_hao_pg&ie=utf-8&wd=python'
body = requests.get(url,headers= headers)
r = parsel.Selector(body.content.decode('utf-8'))
titile = r.xpath('//*[@id="1"]/h3/a[1]').get()
print(titile)
